<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">添加编辑</div>
                <div class="layui-card-body" pad15>
                    <form class="layui-form" action="javascript:;" lay-filter="component-form-group" action="">
                    <div class="layui-form" lay-filter="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">身份名称</label>
                            <div class="layui-input-inline">
                                <input type="text" id="ue_name" value="{$find.ue_name}" autocomplete="off" placeholder="请输入身份名称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">满足条件</label>
                            <div class="layui-input-inline">
                                <input type="text" id="ue_points" value="{$find.ue_points}" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">用户满足该积分后即可审核认证该等级</div>
                        </div>
                        <input type="hidden" id="ue_id" value="{$find.ue_id}">
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="setmyinfo" onclick="sub()">提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
                            </div>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer'], function() {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;
    });
    function sub() {
        var ue_name = $("#ue_name").val();
        var ue_points = $("#ue_points").val();
        var ue_id = $("#ue_id").val();
        $.ajax({
            type:'post',
            url:'{:url("User/leverAddEdit")}',
            data:{ue_name:ue_name,ue_points:ue_points,ue_id:ue_id},
            success: function(data){
                if(data.code>0){
                    layer.msg(data.msg,{icon:1,time:1500});
                    setTimeout(function(){parent.location.reload()},1500);
                }else{
                    layer.msg(data.msg,{icon:5,time:1500});
                }
            }
        });
    }
</script>
</body>
</html>